package com.freework.sys.table.vo;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class PageVO  implements java.io.Serializable{
	private PageFormVO form=null;
	private PageGridVO grid=null;
	private String tablename=null;
	private long lastLoadTime=0;

	
	public long getLastLoadTime() {
		return lastLoadTime;
	}
	public void setLastLoadTime(long lastLoadTime) {
		this.lastLoadTime = lastLoadTime;
	}
	public PageVO clone(){
		PageVO page=new PageVO(tablename);
		page.setForm(form.clone());
		page.setLastLoadTime(lastLoadTime);
		page.getForm().setField(cloneListMap(form.getField()));
		PageGridVO tgrid=new PageGridVO();
		tgrid.setColModel(cloneListMap(grid.getColModel()));
		tgrid.setDataRecord(cloneListMap(grid.getDataRecord()));
		page.setGrid(tgrid);
		return page;
	}
	private List<Map> cloneListMap(List<Map> slist){
		List<Map> tlist=new ArrayList<Map>(slist.size()+1);
		for (Map map : slist) {
			Map tmap=new HashMap(map);
			tlist.add(tmap);
		}
		return tlist;
	}
	
	
	
	public PageVO(String tablename) {
		super();
		this.tablename = tablename;

	}

	public String getTablename() {
		return tablename;
	}

	public void setTablename(String tablename) {
		this.tablename = tablename;
	}

	public PageFormVO getForm() {
		return form;
	}

	public void setForm(PageFormVO form) {
		this.form = form;
	}

	public PageGridVO getGrid() {
		return grid;
	}

	public void setGrid(PageGridVO grid) {
		this.grid = grid;
	}
	
}
